package com.ky.serialport;

import android.content.Context;
import android.util.Log;

import com.ky.serialport.bean.ComBean;
import com.xzkydz.serialport.SerialControl;

public class SerialData {

    private Context context;
    private SerialControl com;
    private boolean _IsRun = true;

    public SerialData(Context context, SerialControl com) {
        this.context = context;
        this.com = com;
    }

    public class CalculateThread extends Thread {
        @Override
        public void run() {
            super.run();
            while (_IsRun){
                try{
                    final ComBean comBean = com.QueueList.poll();
                    if (comBean!=null){

                    }
                }catch (Exception e){
                    Log.d("123456", "run: 解析串口数据的时候产生异常");
                }
            }
        }
    }


    /**
     *
     * @param run
     */
    public void setIsRun(boolean run){
        _IsRun = run;
    }
}
